//
//  BaseViewController+Hud.m
//  HSY
//
//  Created by 陈浩 on 2017/4/17.
//  Copyright © 2017年 金开门. All rights reserved.
//

#import "BaseViewController+Hud.h"
#import <UIView+Toast.h>


@implementation BaseViewController (Hud)

- (void)showMessageInWindow:(NSString *)message hidenDelay:(CGFloat)delay{
    if (delay < 0) {
        [[UIApplication sharedApplication].keyWindow makeToast:message];
    }else{
        [[UIApplication sharedApplication].keyWindow makeToast:message duration:delay position:[CSToastManager defaultPosition]];
    }
}

- (void)showMessage:(NSString *)message hidenDelay:(CGFloat)delay{
    [self.view hideToasts];
    
    if (delay < 0) {
        [self.view makeToast:message duration:[CSToastManager defaultDuration] position:CSToastPositionCenter];
    }else{
        [self.view makeToast:message duration:delay position:CSToastPositionCenter];
    }
    
}

- (void)showMessage:(NSString *)message{
    [self showMessage:message hidenDelay:-1];
}

@end
